/* tool-box.mode.vala
 *
 * Copyright (C) 2010  Richard Talbot-Watkins
 * Copyright (C) 2010  Dave Jeffery
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Authors:
 *  Richard Talbot-Watkins <richtw1@gmail.com>
 * 	Dave Jeffery <david.richard.jeffery@gmail.com>
 */
 
/**
 * Toolbox editing mode.
 *
 * Allows editing mode to be passed by reference instead of by value. It
 * also allows for the edit mode to emit a signal when changed, which may
 * be of use if the edit mode can be changed from the menu and keyboard
 * too.
 * 
 * I know that this seems like overkill, which it undoubtedly is, but I'm
 * using this project to learn vala ;)
 *
 * @author Dave Jeffery <david.richard.jeffery@gmail.com>
 * @version 2010.1218
 * @since 0.1
 */
private class MonsterDesigner.ToolBoxMode : GLib.Object {
	/**
	 * Signal emitted when toolbox mode changed.
	 */
	public signal void changed ();		

	/**
	 * Sprite editing mode.
	 */
	private Mode _mode = Mode.DRAW;

	/**
	 *  Getter/Setter for sprite editing mode.
	 */
	public Mode mode { 
		get {
			return _mode;
		}
		set {
			if (value != _mode) {
				_mode = value;
				changed();
			}
		}
	}
}
